package com.heima.admin.controller;


import com.heima.model.admin.dtos.UserAuthDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.admin.service.UserAuthService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/api/v1")
@RequiredArgsConstructor
public class UserAuthController {

    private final UserAuthService userAuthService;

    /**
     * 分页查询
     * @param userAuthDto
     * @return
     */
    @PostMapping("/auth/list")
    public ResponseResult getList(@RequestBody UserAuthDto userAuthDto) {
        ResponseResult list = userAuthService.getList(userAuthDto);
        return list;
    }

    /**
     * 审核失败
     * @param userAuthDto
     * @return
     */
    @PostMapping("/auth/authFail")
    ResponseResult authFail(@RequestBody UserAuthDto userAuthDto){
        ResponseResult authFail = userAuthService.authFail(userAuthDto);
        return authFail;
    }

    /**
     * 审核成功
     * @param userAuthDto
     * @return
     */
    @PostMapping("/auth/authPass")
    ResponseResult authPass(@RequestBody UserAuthDto userAuthDto){
        ResponseResult authPass = userAuthService.authPass(userAuthDto);
        return authPass;
    }

}
